package singleton;

public class Main {
    public static void main(String[] args) {
        System.out.println("开始");
        Singleton singleton1 = Singleton.getInstance();
        Singleton singleton2 = Singleton.getInstance();
        if (singleton1 == singleton2) {
            System.out.println("这里玩意是一样的");
        } else {
            System.out.println("这俩不是一个东西");
        }
        System.out.println("结束");

        System.out.println("练习：单例");
        TicketMaker ticketMaker = TicketMaker.getInstance();
        System.out.println(ticketMaker.getNextTicketNumber());
        System.out.println(ticketMaker.getNextTicketNumber());
    }
}
